#!/usr/bin/env node

const Koa = require('koa');

const app = new Koa();

app.use((ctx,next)=>{     //M-power-logger
  const start = Date.now();

  next();

  const end = Date.now();

  console.log(`${ctx.method} ${ctx.path} - cost:${end - start}ms`);
});

app.use((ctx,next)=>{     //M-hello
  ctx.body = 'hello world';
});



app.listen(8080);
